/* Common styles for SignUpModal and SignInModal */

.dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(400px, 90vw);
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow-y: auto;
  background:
    linear-gradient(
      179deg,
      rgba(29, 237, 131, 0.12) 0.79%,
      rgba(29, 237, 131, 0) 99.35%
    ), var(--global-background);
  border: none;
  border-radius: var(--border-radius-xl, 0.75rem);
  box-shadow:
    0px 4px 20px 0px var(--shadow-basic-shadow, #000),
    0 4px 80px 0 rgba(29, 237, 131, 0.1) inset;
  transform: translate(-50%, -50%);
}

.dialog::before {
  position: absolute;
  inset: 0;
  padding: 1px;
  pointer-events: none;
  content: '';
  background: linear-gradient(
    to bottom,
    rgba(29, 237, 131, 0.5),
    rgba(195, 255, 224, 0.5),
    rgba(4, 84, 44, 0.5)
  );
  border-radius: var(--border-radius-xl, 0.75rem);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* Fallback for browsers that don't support mask-composite */
@supports not (mask-composite: exclude) {
  .dialog::before {
    position: absolute;
    inset: 0;
    padding: 0;
    pointer-events: none;
    content: '';
    background: none;
    border: 1px solid var(--global-border);
    border-radius: var(--border-radius-xl, 0.75rem);
  }
}

.dialogContent {
  padding: 0;
}

.dialogHeader {
  position: relative;
  padding: var(--spacing-4);
}

.closeButton {
  position: absolute;
  top: var(--spacing-4);
  right: var(--spacing-4);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: var(--spacing-1);
  color: var(--primary-color);
  cursor: pointer;
  background: none;
  border: none;
  border-radius: var(--border-radius-full);
  transition:
    background-color var(--default-hover-animation-duration),
    transform var(--default-hover-animation-duration);
}

.closeButton:hover {
  color: var(--primary-color);
  background-color: var(--primary-overlay-15);
  transform: scale(1.05);
}

.closeButton:focus-visible {
  outline: 2px solid var(--primary-accent);
  outline-offset: 2px;
  border-radius: var(--border-radius-full);
  box-shadow: 0px 0px 60px 8px var(--primary-overlay-40);
}

.authContent {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-8);
  padding: 0 var(--spacing-10) var(--spacing-10);
}

.titleWrapper {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
  align-items: center;
}

.logoMark {
  width: 2.5rem;
  height: 2.5rem;
}

.title {
  margin-bottom: var(--spacing-6);
  font-size: var(--font-size-8);
  font-weight: 400;
  color: var(--global-foreground);
  text-align: center;
}

.oauthList {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
  width: 100%;
}

.divider {
  display: flex;
  align-items: center;
  margin: var(--spacing-4) 0;
  color: var(--overlay-70);
}

.divider::before,
.divider::after {
  flex: 1;
  content: '';
  border-bottom: 1px solid var(--global-border);
}

.divider span {
  padding: 0 var(--spacing-2);
  font-size: var(--font-size-3);
}

.oauthButton {
  display: flex;
  gap: var(--spacing-2);
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: var(--spacing-3) var(--spacing-4);
  font-size: var(--font-size-4);
  font-weight: 500;
  color: var(--global-foreground);
  cursor: pointer;
  background-color: transparent;
  border: 1px solid var(--global-border);
  border-radius: var(--border-radius-md);
  transition: all 0.2s ease;
}

.oauthButton:hover {
  background-color: var(--overlay-5);
  border-color: var(--overlay-20);
}

.oauthButton:focus-visible {
  outline: 2px solid var(--primary-accent);
  outline-offset: 2px;
  border-radius: var(--border-radius-md);
}

@media (prefers-reduced-motion: reduce) {
  .oauthButton {
    transition: none;
  }
}

.switchAuth {
  margin-top: var(--spacing-2);
  font-size: var(--font-size-3);
  color: var(--overlay-60);
  text-align: center;
}

.authSwitchLink {
  margin-left: 12px;
  font-size: inherit;
  font-weight: 600;
  color: var(--global-foreground);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  transition: opacity 0.2s ease;
}

.authSwitchLink:hover {
  text-decoration: underline;
  opacity: 0.8;
}

.authSwitchLink:focus-visible {
  outline: 2px solid var(--primary-accent);
  outline-offset: 2px;
  border-radius: var(--border-radius-sm);
}

/* Respect users' reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .closeButton {
    transition: none;
  }
}

/* Form styles for SignUpModal */
.form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-5);
}

.formGroup {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
}

.label {
  font-size: var(--font-size-3);
  font-weight: 500;
  color: var(--global-foreground);
}
